<?php


namespace App\Controller;

use function OpenApi\scan;
use OpenApi\Annotations as OA;


/**
 * 只能识别常量
 * @OA\Server(url="http://test.site")
 * @OA\Info(
 *     title="Auth API",
 *     version="1.0",
 *     @OA\Contact(
 *         email="support@example.com"
 *     )
 * )
 * 目前研究结果：1.不知道怎么去定义一个索引数组。2.不知道response怎么返回数组
 */

class Swagger
{
    public function autoDocs()
    {
        $openapi = scan(APP_PATH);
        header('Content-Type: application/x-yaml');
        echo $openapi->toYaml();
        die;
    }

}